<?php use_helper("Javascript","I18N") ?>
<ul class="passwordlist">
  <?php foreach ($groups as $group_id => $group): ?>
    <li id="group_<?php echo $group_id ?>">
      <h3>
        <?php echo link_to_remote($group->getTitle(),
          array(
                "url" => "passwords/editGroup/?id=" . $group_id,
                "update" => "edit_form"
          )) ?>
        (<?php echo $group->getPasswords()->count() ?>)
      </h3>
    <?php echo drop_receiving_element("group_" . $group_id, array(
        "url" => "passwords/movePassword/?group=" . $group_id,
        "accept" => "passwords",
        "hoverclass" => "passworddrop_hover",
//        "update" => "edit_form",
         "complete" => remote_function(array(
          "update"=> "password_list",
          "url" => "passwords/list",
          "script" => true
        ))
    )) ?>
      <ul>
        <?php foreach($group->getPasswords() as $id => $password):  ?>
        <li id="password_<?php echo $group_id . "_" . $id ?>" class="passwords">
        <?php echo link_to_remote($password->getTitle(),
          array(
                "url" => "passwords/showPassword/?group=" . $group_id . "&id=" . $id,
                "update" => "password_display"
          )) ?>
        <?php echo link_to_remote("[". __("edit") . "]",
          array(
                "url" => "passwords/edit/?group=" . $group_id . "&id=" . $id,
                "update" => "edit_form"
          )) ?>
        </li>
        <?php echo draggable_element("password_" . $group_id . "_" . $id, array("ghosting" => true, "revert" => true)) ?>
        <?php endforeach; ?>
      </ul>
    </li>
  <?php endforeach; ?>
</ul>

<div id="eins">eins</div>
